package com.edu.leetcode.dataStruct;

import java.util.Arrays;

/**
 * @作者 five-five
 * @创建时间 2021/1/5
 */
public class Demo05 {
    public static void main(String[] args) {
        Demo05 demo05 = new Demo05();
        boolean b = demo05.containsDuplicate(new int[]{1, 2, 4, 1, 5, 6, 6, 6});
        System.out.println(b);
    }

    /**
     * 217 存在重复元素 | Contains Duplicate
     * @param nums
     * @return
     */
    public boolean containsDuplicate(int[] nums) {
        return Arrays.stream(nums).distinct().count()==nums.length;
    }
}
